<!DOCTYPE html>
<html>

<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
	<title>sss</title>
	<script src="js/mui.min.js"></script>
	<link href="css/mui.min.css" rel="stylesheet" />
	<script src="js/md5.js"></script>
	<script type="text/javascript" charset="utf-8">
		mui.init();
		function singy (data) {
			
			let str = "";
			for (let i in data) {
				str += i + ":" + data[i];
			}
			str=str.toString();
			console.log(str);
			console.log(md5(str));
			return md5(str);
		}


		//⬇领取群红包
				
		var data={
			user:123456
		}
		mui.ajax('http://localhost:3001/users/login',{
			data: data,
			type: 'post', //HTTP请求类型
			headers: {
				'Content-Type': 'application/json',
				'singy': singy(data)
			},
			success: function (data) {
				//获得服务器响应
				
				console.log(data)
			}
		});



		var data = {
			/* 
			receive_id:领取人的ID
        	receive_red_uid:领取的红包的UID
        	receive_red_token:领取的红包的token
			*/
			receive_id:123456,
			receive_red_uid:59,
			receive_red_token:"GFLVw4PnJb"
		};

		mui.ajax('http://localhost:3001/redenvelopes/receive2group', {
			data: data,
			type: 'post', //HTTP请求类型
			headers: {
				'Content-Type': 'application/json',
				'singy': singy(data)
			},
			success: function (data) {
				//获得服务器响应
				console.log(data);
			}
		});


	</script>
</head>

<body>

</body>

</html>